package rsb21424yhc.d1202YiChang;

import java.util.Scanner;

public class demo01 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入被除数");
        int x=sc.nextInt();
        System.out.println("请输入除数");
        int y=sc.nextInt();
        try{
            int ret=div(x,y);
            System.out.println(x+"除以"+y+"商是"+div(x,y));
        }catch (Exception e){
            System.out.println(e.getMessage());
        }

    }
    public static int div(int x,int y)throws Exception{
        if (y==0){
            throw new Exception("被除数不能是0");
        }
        int ret=x/y;
        return ret;
    }
}
